RAIS  3.2
C:/Projekte/RAIS/dataaccesslayertest/CommonClasses/DynamicMaskTest.cs
Go to the documentation of this file.
00001 using System;
00002 using System.Collections.Generic;
00003 using System.Text;
00004 using NUnit.Framework;
00005 using RAIS.Common.DynamicMaskManagement;
00006 using RAIS.Common.TableManagement;
00007 using RAIS.DataAccessLayer;
00008 
00009 namespace RAIS.DataAccessLayerTest.CommonClasses
00010 {
00011         [TestFixture]
00012         public class DynamicMaskTest
00013         {
00014                 DynamicMask.DynamicMaskTypeData dynamicMaskTypeData;
00015         DynamicMask dynamicMask;
00016 
00017                 [SetUp]
00018                 public void Init()
00019                 {
00020             this.dynamicMask = new DynamicMask();
00021 
00022                         // The dynamicMaskTypesDictionary field is initialized in DynamicMaskManagement 
00023                         // static constructor, so, create new DynamicMaskManagement object to 
00024                         // initialize fieldTypesDictionary field.
00025                         DynamicMaskManagement dynamicMaskManagement = new DynamicMaskManagement();
00026 
00027                         this.dynamicMaskTypeData = new DynamicMask.DynamicMaskTypeData();
00028                 }
00029                 [Test]
00030                 public void DynamicMaskTypesDictionary_Count()
00031                 {
00032                         // Preparations
00033                         int expectedCount = 4;
00034 
00035                         // Test 
00036                         Assert.AreEqual(expectedCount, DynamicMask.DynamicMaskTypesDictionary.Count);
00037                 }
00038                 [Test]
00039                 public void DynamicMaskTypesDictionary_SingleRowMaskWithList()
00040                 {
00041                         // Preparations
00042                         int expectedID = 1;
00043                         DynamicMask.DynamicMaskType expectedType = DynamicMask.DynamicMaskType.SingleRowMaskWithList;
00044                         string expectedVisibleName = "Single Row Mask with List";
00045                         string expectedReference = "~/Dynamic Masks/SingleRowMaskWithList.aspx";
00046 
00047                         // Test
00048                         this.dynamicMaskTypeData = DynamicMask.DynamicMaskTypesDictionary[expectedType];
00049 
00050                         // Checks
00051                         Assert.AreEqual(expectedID, this.dynamicMaskTypeData.ID);
00052                         Assert.AreEqual(expectedType, this.dynamicMaskTypeData.Type);
00053                         Assert.AreEqual(expectedVisibleName, this.dynamicMaskTypeData.VisibleName);
00054                         Assert.AreEqual(expectedReference, this.dynamicMaskTypeData.Reference);
00055                 }
00056                 [Test]
00057                 public void DynamicMaskTypesDictionary_ListWithFilter()
00058                 {
00059                         // Preparations
00060                         int expectedID = 2;
00061                         DynamicMask.DynamicMaskType expectedType = DynamicMask.DynamicMaskType.ListWithFilter;
00062                         string expectedVisibleName = "List With Filter";
00063                         string expectedReference = "~/Dynamic Masks/ListWithFilter.aspx";
00064 
00065                         // Test
00066                         this.dynamicMaskTypeData = DynamicMask.DynamicMaskTypesDictionary[expectedType];
00067 
00068                         // Checks
00069                         Assert.AreEqual(expectedID, this.dynamicMaskTypeData.ID);
00070                         Assert.AreEqual(expectedType, this.dynamicMaskTypeData.Type);
00071                         Assert.AreEqual(expectedVisibleName, this.dynamicMaskTypeData.VisibleName);
00072                         Assert.AreEqual(expectedReference, this.dynamicMaskTypeData.Reference);
00073                 }
00074                 [Test]
00075                 public void DynamicMaskTypesDictionary_SingleRowMask()
00076                 {
00077                         // Preparations
00078                         int expectedID = 3;
00079                         DynamicMask.DynamicMaskType expectedType = DynamicMask.DynamicMaskType.SingleRowMask;
00080                         string expectedVisibleName = "Single Row Mask";
00081                         string expectedReference = "~/Dynamic Masks/SingleRowMask.aspx";
00082 
00083                         // Test
00084                         this.dynamicMaskTypeData = DynamicMask.DynamicMaskTypesDictionary[expectedType];
00085 
00086                         // Checks
00087                         Assert.AreEqual(expectedID, this.dynamicMaskTypeData.ID);
00088                         Assert.AreEqual(expectedType, this.dynamicMaskTypeData.Type);
00089                         Assert.AreEqual(expectedVisibleName, this.dynamicMaskTypeData.VisibleName);
00090                         Assert.AreEqual(expectedReference, this.dynamicMaskTypeData.Reference);
00091                 }
00092                 [Test]
00093                 public void DynamicMaskTypesDictionary_ReportMask()
00094                 {
00095                         // Preparations
00096                         int expectedID = 4;
00097                         DynamicMask.DynamicMaskType expectedType = DynamicMask.DynamicMaskType.ReportMask;
00098                         string expectedVisibleName = "Report Mask";
00099                         string expectedReference = "~/Dynamic Masks/ReportMask.aspx";
00100 
00101                         // Test
00102                         this.dynamicMaskTypeData = DynamicMask.DynamicMaskTypesDictionary[expectedType];
00103 
00104                         // Checks
00105                         Assert.AreEqual(expectedID, this.dynamicMaskTypeData.ID);
00106                         Assert.AreEqual(expectedType, this.dynamicMaskTypeData.Type);
00107                         Assert.AreEqual(expectedVisibleName, this.dynamicMaskTypeData.VisibleName);
00108                         Assert.AreEqual(expectedReference, this.dynamicMaskTypeData.Reference);
00109                 }
00110         }
00111 }